package cn.ex.ymcc.feign.fallback;

import cn.ex.ymcc.domain.CourseUserLearn;
import cn.ex.ymcc.feign.CourseUserLearnFeignClient;
import cn.ex.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseUserLearnFeignClientFallbackFactory implements FallbackFactory<CourseUserLearnFeignClient> {

    @Override
    public CourseUserLearnFeignClient create(Throwable throwable) {
        return new CourseUserLearnFeignClient() {
            @Override
            public JSONResult courseOrderInfo(String courseIds) {
                return JSONResult.error("服务不可达");
            }

            @Override
            public JSONResult selectForUser(Long courseId) {
                return JSONResult.error("服务不可达");
            }

        };
    }
}
